
package com.jy.rhin.facade.ws.basic.notification;

import cn.org.chiss.rhin._2015.base.object.ResourceUnknownFault;
import cn.org.chiss.rhin._2015.base.object.UnableToDestroySubscriptionFault;
import com.jy.rhin.application.basic.NotificationService;
import com.jy.rhin.config.NamespaceConstants;
import com.jy.rhin.support.aspect.AuditLog;
import lombok.extern.slf4j.Slf4j;
import org.oasis_open.docs.wsn.b_2.Unsubscribe;
import org.oasis_open.docs.wsn.b_2.UnsubscribeResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.jws.WebService;

/**
 * @Description: 基础通知-订阅
 */
@WebService(
        serviceName = "SubscriptionManage",
        portName = "SubscriptionManagePort",
        targetNamespace = NamespaceConstants.NS_RHIN,
        endpointInterface = "com.jy.rhin.facade.ws.basic.notification.SubscriptionManager")

@Component
@Slf4j
public class SubscriptionManagerPortImpl implements SubscriptionManager {
    @Autowired
    NotificationService notificationService;

    @Override
    @AuditLog
    public UnsubscribeResponse unsubscribe(Unsubscribe unsubscribeRequest) throws UnableToDestroySubscriptionFault, ResourceUnknownFault {
        return notificationService.unsubscribe(unsubscribeRequest);
    }
}
